// 该类型就是 获取用户个人资料 时，接口返回的数据格式
type ProfileState = {
  id: string
  name: string
  photo: string
  art_count: number
  follow_count: number
  fans_count: number
  like_count: number
}

const initialState = {} as ProfileState

export type ProfileType = {
  type: 'profile/userInfo'
  payload: ProfileState
}

const profile = (state = initialState, action: ProfileType) => {
  switch (action.type) {
    case 'profile/userInfo':
      return action.payload
    default:
      return state
  }
}

export { profile }
